package com.emr.common;

public class Polymorphism {
	public final static String INT_TYPE = "Integer";
	public final static String LONG_TYPE = "Long";
	public final static String DOUBLE_TYPE = "Double";
	public final static String FLOAT_TYPE = "Float";
	public final static String CHAR_TYPE = "char";
	public final static String BYTE_TYPE = "byte";
	public final static String SHORT_TYPE = "short";
	
	public static String getType(int i) {
		return INT_TYPE;
	}

	public static String getType(long l) {
		return LONG_TYPE;
	}

	public static String getType(double d) {
		return DOUBLE_TYPE;
	}

	public static String getType(float f) {
		return FLOAT_TYPE;
	}

	public static String getType(char c) {
		return CHAR_TYPE;
	}

	public static String getType(byte by) {
		return BYTE_TYPE;
	}

	public static String getType(short s) {
		return SHORT_TYPE;
	}

	/**
	 * ie:javaBasic.Polymorphism@de6ced to:javaBasic.Polymorphism
	 * 
	 * @param obj
	 * @return
	 */
	public static String getType(Object obj) {
		return obj != null ? obj.toString().split("@")[0] : null;
	}

}